Skip to main content

User Generated Clips

You might want to allow your users to create their own custom clip within your app. To do this using the Clips API, you'll:

  1. Request the full track via /track-fetch to let the user audition 60 second sections of the song to clip.
  2. Provide a UI to let your user to select their desired clip (60 seconds max).
  3. Send an event request to /track-play for each play during the auditioning process.
  4. Request creation of the custom clip via /clip, including start and end times in seconds.
  5. Use the returned custom clip id for subsequent /music-fetch, /add, /play, /share, and /download events.

At step 2, we recommend defaulting the start/end points to the same timestamps as the curated clip. This way, your user can have a head start tweaking the clip to their liking from the best part of the song. This is also preferred UX because the user will start the Custom Clipping experience hearing the same exact section of a track that plays during a preview.

Accessing the Curated Clip times

The /track-fetch response contains a curatedClip object, which provides the following parameters that will provide the relevant data to inform your custom clipping UI of the correct start/end points:

    "startMs": {
"type": "number",
"description": "Start offset in milliseconds from the beginning of the track"
},
"stopMs": {
"type": "number",
"description": "Stop offset in milliseconds from the beginning of the track"
},
"id": {
"type": "number",
"description": "Unique identifier for the curated clip"
}